package yxy.game.pm2.bean.pubsub;

import yxy.apple.util.PubSub.ISubscription;
import yxy.apple.util.PubSub.Publisher;

/** 竞技场排名发布者 */
public class ArenaRankPublisher extends Publisher {
	static private ArenaRankPublisher instance;

	public static ArenaRankPublisher getInstance() {
		if (instance == null) {
			instance = new ArenaRankPublisher();
		}
		return instance;
	}

	private ArenaRankPublisher() {

	}

	public void publish(String playerCode, int rank) {
		this.publish(new ArenaRankSubscription(playerCode, rank));
	}

	public static class ArenaRankSubscription implements ISubscription {
		private String playerCode;
		private int rank;

		public ArenaRankSubscription(String playerCode, int rank) {
			this.playerCode = playerCode;
			this.rank = rank;
		}

		public String getPlayerCode() {
			return playerCode;
		}

		public int getRank() {
			return rank;
		}

	}

}
